<?php

class textfield extends components {
    
    public function generate($page, $tag) {
        
        # Create the component
        $textfield = '<input type="text" value="'.$this->value.'" name="'.$this->name.'" class="componentField"/>';
        
        # Add the component to the defaultcomponent template
        $this->componentPage->append($this->label,'componentLabel');
        $this->componentPage->append($textfield,'componentComponent');
        $this->componentPage->append($this->name, 'componentID');
        
        # If needed add extra cssClasses
        if(isset($this->cssClass)) {
            $this->componentPage->append($this->cssClass,'componentClass');
        }
        
        # Add the component to the form
        $component = $this->componentPage->generateTemplate(true);
        
        $page->append($component,$tag);
        
        parent::generate($page, $tag);
        
    }
    
}

?>
